function* fib(max) 
{
    var t,
        a = 0,
        b = 1,
        n = 0;
    while (n < max) 
    {
        yield a;
        [a, b] = [b, a + b];
        n++;
    }
    return;
}

function* next_id()
{
    var i = 0;
    while(true)
    {
        yield i+1;
        i++;
    }
}
var f = fib(5);